//
//  TableViewCellOfComment.m
//  Beauty
//
//  Created by Snow on 16/9/14.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "TableViewCellOfComment.h"
#import "GXMacro.h"
@implementation TableViewCellOfComment
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _image = [[UIImageView alloc] init];
        [self.contentView addSubview:_image];
        _labelOfName = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfName];
        _labelOfTime = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfTime];
        _labelOfomment = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfomment];
        _labelOfLikeCount = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfLikeCount];
        _buttonOfLike = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:_buttonOfLike];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(10);
        make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
        make.height.mas_equalTo(40);
        make.width.mas_equalTo(40);
    }];
    _image.layer.masksToBounds = YES;
    _image.layer.cornerRadius = 20;
    [_labelOfName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_right).mas_equalTo(5);
        make.top.mas_equalTo(_image.mas_top);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(200);
    }];
    [_labelOfTime mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_labelOfName.mas_left);
        make.right.mas_equalTo(_labelOfName.mas_right);
        make.top.mas_equalTo(_labelOfName.mas_bottom);
        make.height.mas_equalTo(15);
    }];
    _labelOfTime.font = [UIFont systemFontOfSize:12];
    [_labelOfomment mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_right);
        make.top.mas_equalTo(_labelOfTime.mas_bottom);
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
        make.height.mas_equalTo(80);
    }];
    _labelOfomment.numberOfLines = 0;
    _labelOfomment.font = [UIFont systemFontOfSize:17];
    [_buttonOfLike mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-60);
        make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(20);
    }];
    [_buttonOfLike setImage:[UIImage imageNamed:@"buttonOfLove"] forState:UIControlStateNormal];
    [_labelOfLikeCount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-30);
        make.left.mas_equalTo(_buttonOfLike.mas_right).mas_equalTo(10);
        make.height.mas_equalTo(20);
        make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
    }];
}
@end
